<%@ page language="java" import="java.util.*,com.hs.core.cache.*,com.hs.auth.*,com.hs.auth.model.*" pageEncoding="utf-8"%>
<%@page import="com.hs.dnms.action.statics.StaObj"%>
 <%
    Set  tablist = (Set)request.getAttribute("tabdata"); 
    String  diseaseclass = (String)request.getAttribute("diseaseclass"); 
    String  dysnasty = (String)request.getAttribute("dysnasty"); 
  String  imagestr = (String)request.getAttribute("imagestr");  
  String  dysstr = (String)request.getAttribute("dysstr"); 
  HsAccount accInfo = (HsAccount)request.getSession().getAttribute(AUTHConstant.USERINSESSION);
	String lang = accInfo.getCreatuser() + "";
  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="../../include.jsp"%> 
<script language="javascript" type="text/javascript" src="<%=path %>/thirtpart/My97DatePicker/WdatePicker.js"></script>
<script src="<%=basePath %>app/javascripts/transform.js"></script>
<script language="javascript" type="text/javascript" src="<%=path %>/thirtpart/highcharts216/highcharts.js"></script>
<script language="javascript" type="text/javascript" src="<%=path %>/thirtpart/highcharts216/modules/exporting.js"></script>
<script language="javascript" type="text/javascript">
 function staticDetail(detailname,countsql){
 	var pageURL = "<%=basePath%>static/staticdetail.do?countsql="+encodeURIComponent(countsql) + "&detailname=" + encodeURIComponent(detailname); 
	openwindow(pageURL,'1000','800',''); 
 }
 function s2t()
{
	document.body.innerHTML = document.body.innerHTML.s2t();
}
function t2s()
{
	document.body.innerHTML = document.body.innerHTML.t2s();
}
</script>
</head>
<body>
<form name="searchform" action="<%=basePath %>statics/magacount.do" method='post'>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="deta_list_sear">
      <tr>
        <td width="15%">
          疾病类别：
        </td>
        <td width="20%">
           <input type="text"  id="diseaseclass" value="<%=diseaseclass==null?"":diseaseclass %>" class="sear_input" name="diseaseclass"  />
        </td>  
        <td width="15%">
          朝代：
        </td>
         <td width="20%">
           <input type="text" id="dysnasty" value="<%=dysnasty==null?"":dysnasty %>" class="sear_input" name="dysnasty" />
         </td>
         <td width="10%" align="left">
            <input  type="submit" value="统计" class="but_2"/>
        </td>
        <td width="5%" align="right">
            <input  type="button" value="简体" onclick="t2s();" class="but_2"/>
        </td>
         <td width="5%" align="left">
            <input  type="button" value="繁体" onclick="s2t();" class="but_2"/>
        </td>
         <td width="10%" align="left">
            &nbsp;
        </td>
        </tr>
    </table>
</form>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list">
<tr style="height:100%">
<td> 
	<table border="0" cellspacing="0" cellpadding="0" class="list" > 
      <tr>
        <th width="10%">序号</th>  
        <th width="50%">疾病类别</th>
        <th width="40%">古籍条目数</th> 
      </tr>   
       <%if(tablist != null && tablist.size()>0){  
            Iterator iter = tablist.iterator();
            int i = 0;
      		while(iter.hasNext()){
      		    StaObj obj = (StaObj)iter.next();
      			//Map data = (Map)tablist.get(i); 
      			String yearStr = obj.getPname();
      			String yearcount = obj.getCountnum()+"";
      			//System.out.println("::::::;" + data.get("countsql"));
      			String countsql = obj.getCountsql();
      			i++;
      %> 
      <tr>
        <td align="center"><%= i %></td> 
        <td><%=yearStr %></td>
        <td><a href="javaScript:staticDetail('<%=yearStr %>','<%=countsql %>')"><%=yearcount%></a></td> 
       </tr>  
      <%}}else{ %>
      <tr>
        <td align="center" colspan="3"><font color="red">没有数据</font></td>
      </tr>
      <%} %>
    </table>
    </td> 
    </tr>
    <tr>
    <td >
    	<div id="container" class="highcharts-container" style="height:100%; margin: 0 2em; clear:both; min-width: 300px">
    
    </td>
 </tr>  
 </table>
</body>
</html>
<script language="javascript" type="text/javascript">

var chart;
$(document).ready(function() {
   chart = new Highcharts.Chart({
      chart: {
         renderTo: 'container',
         defaultSeriesType: 'line'
      },
      title: {
         text: '<strong><font color=red size=3>多囊卵巢综合征古籍文献发展趋势图</font></strong>'
      },
      subtitle: {
         text: ''
      },
      xAxis: {
         categories: <%=dysstr%>
      },
      yAxis: {
         title: {
            text: '<strong>文献数量（篇）</strong>'
         }
      },
      tooltip: {
         enabled: false,
         formatter: function() {
            return '';
         }
      },
      plotOptions: {
         line: {
            dataLabels: {
               enabled: false
            },
            enableMouseTracking: false
         }
      },
		exporting: {
		
		filename: "chart",
		
		type: "image/png",
		
		url: '<%=basePath%>image/export.do',
		
		width: 800
		
		},
   series: [<%=imagestr%>]
   });

});

function fonttransfer(){
  //var fontobj = window.parent.document.all.fonttype;
 // if(fontobj !=null && fontobj !=undefined){
  	//var fonttype = fontobj.value;
  	var fonttype = <%=lang%>;
  	if(fonttype == "2"){
  		document.body.innerHTML = document.body.innerHTML.s2t();
  	}else {
  		document.body.innerHTML = document.body.innerHTML.t2s();
  	} 
  //}    
}
setTimeout("fonttransfer()",3000);
  

</script>

